Anybody remotely sane that follows the news will have noticed a recent uptick in the past 4 or so years in leftist insanity regarding issues of so-called "social justice". I believe there is now a regular pattern of companies committing some faux pas according to the "social justice" left, usually pertaining to some percieved racism or sexism committed by the company or a reprasentative of the company. While it's true that only a small percentage of people actually believe in this far-left conception of "social justice", the true believers are for various reasons disproportionately represented in the media, meaning that these "faux-faux-pas" are often highlighted disproportionately in the news.
To complicate matters, we live in a society run amuck with corporate facism, by which I mean that corporations of certain sizes and industries recieve special government privilege, absolving the individuals responsible for them of legal responsibility for even blatant negligence and incompetence (aka impunity, see Equifax/Google/Facebook/etc). In this case, the justified outrage is often reported in the media as well.
My intuition is that these controversies can effect the market in a predictable way: when companies of a certain size or status (this will need a better definition) come under fire for faux or real controversy, the market responds emotionally. Angry/offended traders, or traders who believe many others will be angry/offended, undervalue the stock of the company under fire.
In the case of the "social justice" controversies, I predict that the company under fire takes a hit for superficial reasons, but their true underlying value is unnaffected. As I said previously, only a small portion of people genuinely believe in the far-left conception of "social justice", and I think that we can reasonably assume that an even smaller portion of those will actually change their purchasing behavior in response to said controversy. Therefore, the emotional reaction to the controversy will cause the stock to be undervalued and presents an opportunity for us to buy low and sell high.
In the case of corporate impunity controversies, my hypothesis is that the company under fire will again take a hit, this time due to genuine moral failings. However due to rampant corporatism, this short term dip in price will reliably be reversed, since these corporations are largely immune to their criminal or ethical failings and via government privilege will remain as valuable as before. Again this miscalculation by the market to recognize this impunity will be another opportunity to buy low and sell high.
Of course everything above is merely my own intuition and speculation. In order to determine whether this hypothesis is actually true, I have gathered data from a variety of recent controversies over the past few years, starting from the articles listed below. I verified the dates and circuimstances of each controversy through further research (those sources will be enumerated later alongside their relevant stock market data). Many thanks to some guy named Geoffery James who apparently has made corporate scandal recaps his forte.
In order to determine if there is any validity to my hypothesis, my strategy is to visualize the relevant stock price data around what I've determined to be the start time of each controversy. To do this, I will create graphs of relevant stock data 30 days, 90 days, and 180 days either side of the date of the controversy (simply ignoring weekends). These timeframes are chosen to give a picture of data over multiple relevant timeframes, and can be easily adjusted later if it's determined that different angles should be looked at. The adjusted close value is used.
The spreadsheet detailing my manual research (saved as CSV) can be be found under data/controversy_data.csv (or click link to download).
The stock market data is taken from the Alpha Vantage API, which is a freemium service that appears to get good reviews based on some cursory Google searches.
Each row of the CSV data is converted to a Controversy object defined in model/Controversy.py
Unfortunately for the free version of the Alpha Vantage service, they have an API call limit but leave that up for the user to guess at (idk what the strategy is here, maybe they're just trying to piss the user off enough to give up and pay for the premium service.). I've found that if I limit call volume to once per minute, I can safely assume I won't get locked out. In order to prevent my code from taking ~60-90 minutes to compute every time it's run, I've chosen to create a separate script to make all the API calls to gather the stock market, and then serialize the list of Controversy objects -- each including their relevant stock data -- into a data/controversies.pickle. This way, I can simply run this time-expensive script to gather the data once and quicken my iteration cycle for code doing the actual parsing and displaying of the data.
import pandas as pd
import pickle
from datetime import datetime
from model.Controversy import Controversy
import matplotlib.pyplot as plt
from IPython.display import Markdown, display
def printmd(string):
display(Markdown(string))
PIK = "data/controversies.pickle"
# load list of controversies
with open(PIK, "rb") as f:
controversies = pickle.load(f)
# sort alphabetically
controversies.sort(key=lambda x: x.company)
%matplotlib inline
%pylab inline
import pylab
pylab.rcParams['figure.figsize'] = (10, 6) # set figure size
# Generate Analysis for each controversy
for controversy in controversies:
try:
display(Markdown("### " + controversy.company))
print("Relevant Stock(s): {}".format(controversy.stocks))
print("Date: {}".format(controversy.date.strftime("%Y-%m-%d")))
print("Summary: {}".format(controversy.summary))
if controversy.notes == controversy.notes: #hack-y way to check for nan vals
print("Notes: {}".format(controversy.notes))
print("Source: {}".format(controversy.source))
controversy.get_N_day_plot(30)
controversy.get_N_day_plot(90)
controversy.get_N_day_plot(180)
plt.show()
print()
print()
except:
plt.show()
print("Continuing")
print()
print()
pass